package com.zhj.demo.base;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import java.lang.reflect.AnnotatedElement;

public class BolckChainItemDecoration extends RecyclerView.ItemDecoration{
    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        super.getItemOffsets(outRect, view, parent, state);


        outRect.left = AppUtils.dp2(10);
        outRect.right = AppUtils.dp2(10);
        outRect.top = AppUtils.dp2(10);

        outRect.bottom = AppUtils.dp2(10);



//        int col = parent.getChildAdapterPosition(view) % 4;
//        if(col == 0 || col == 3){
//            if(col == 0){
//                outRect.left = AppUtils.dp2(20);
//                outRect.right = AppUtils.dp2(10);
//            }else if(col == 3){
//                outRect.left = AppUtils.dp2(10);
//                outRect.right = AppUtils.dp2(20);
//            }
//        }else {
//            outRect.left = AppUtils.dp2(10);
//            outRect.right = AppUtils.dp2(10);
//        }

//        if(outRect != null){
//            outRect.left = AppUtils.dp2(9);
//            outRect.right = AppUtils.dp2(9);
//            outRect.bottom = AppUtils.dp2(9);
//            outRect.top = AppUtils.dp2(9);
//        }
    }
}